package us.wili.dev.netty.service.impl;

import com.corundumstudio.socketio.SocketIOServer;
import org.springframework.stereotype.Service;
import us.wili.dev.netty.model.GameResponseDto;
import us.wili.dev.netty.service.NettyEventService;

import javax.annotation.Resource;
import java.util.UUID;

@Service
public class NettyEventServiceImpl implements NettyEventService {

    private static SocketIOServer server;


    @Override
    public void sendText(UUID session, GameResponseDto rsp) {
        if (session == null) {
            return;
        }
        try {
            server.getClient(session).sendEvent("message_event",rsp);
        }catch (Exception e){
            e.printStackTrace();
        }

    }
}
